<?php
header("Access-Control-Allow-origin:*");

$id =$_POST["id"];
$randBB=array(-99,1,99); //待处理  有效  无效
$randBBIndex=mt_rand(0,2);



$statusFX=array(-99,1,99);

$statusFXName=array("审核不通过","待放款","已入账");

function getBBStepName($number){
	if($number==-99){
      return "失效";
	}elseif ($number==1) {
			 return "待处理";
	}elseif($number==99){
 		return "有效";
	}
}











$resArr=array(
    "code"=>200
);


$arrDKJL=array();
$randHasData=mt_rand(0,1);

if($randHasData){
	for ($i = 1; $i <= 20; $i++) {
		$statusFXIndex=mt_rand(0,2);
	$arrDKJL[] = array(
		"id" => $i,
        "typeno"=>1,
        "typeintro" =>"xx报备佣金". $i,
        "name" => "佣金-" . $i,
        "money" =>$i,
        "time"=>"18-08-30 19:55",
        "status"=>$statusFX[$statusFXIndex],
        "statusname"=>$statusFXName[$statusFXIndex]
	   
	);
}
}


$resArr["data"]=array(
		"report"=>array(
			"id"=>$id,
			"realname"=>"某某".$id,
			"step"=>$randBB[$randBBIndex],
		    "stepname"=>getBBStepName($randBB[$randBBIndex]),
			"time"=>"2018-10-11 17:44",
			"origin"=>"团队带客(traic > 谢*尔)"
		),
		"order"=>array(
			"id"=>$id,
			"stepname"=>"代签合同"
		),
		"bills"=>$arrDKJL


	);





echo json_encode($resArr);

?>